package com.sm.dao;

import java.util.List;

import com.github.pagehelper.Page;
import com.sm.model.VideoCourse;
import org.apache.ibatis.annotations.Param;

import com.sm.model.CourseBean;

public interface VideoCourseMapper {
    int deleteByPrimaryKey(Integer videoCourseId);

    int insert(VideoCourse record);

    int insertSelective(VideoCourse record);

    VideoCourse selectByPrimaryKey(Integer videoCourseId);

    VideoCourse selectHomeByPrimaryKey(Integer videoCourseId);

    VideoCourse selectTopSchoolByPrimaryKey(Integer videoCourseId);

    int updateByPrimaryKeySelective(VideoCourse record);

    int updateByPrimaryKey(VideoCourse record);

    List<VideoCourse> selectClassMates(@Param("secondDirectoryId") Integer secondDirectoryId, @Param("teacherId") Integer teacherId);

    List<VideoCourse> selectTopSchoolClassMates(@Param("secondDirectoryId") Integer secondDirectoryId);
    
    
    
    /**
     *	根据视频课程的一级类别id查询其所有的视频
     * @param firstDirectoryId	视频课程的一级类别id
     * @return	
     */
    Page<VideoCourse> selectAllVideoByFirst(@Param("firstDirectoryId")Integer firstDirectoryId);

    Page<VideoCourse> getListBySecondId(@Param("secondId")Integer secondId);
    /**
     *	根据视频课程的一级类别ID和二级类别ID查询其所有的视频课程
     * @param firstDirectoryId		视频课程的一级类别ID
     * @param secondDirectoryId		视频课程的二级类别ID
     * @return
     */
    Page<VideoCourse> selectVideoByFirsetAndSecond(@Param("firstDirectoryId")Integer firstDirectoryId,@Param("secondDirectoryId")Integer secondDirectoryId);
    
    /**
     *	根据输入的搜索内容搜索视频
     */
    Page<VideoCourse> searchVideo(@Param("courseName")String courseName);
    
    /**
     *	查询普通用户免费的视频课程。
     * @return
     */
    Page<VideoCourse> selectFreeVideo(@Param("commonPrice")double commonPrice);
    
    /**
     *	查询非普通用户的免费视频
     * @return
     */
    Page<VideoCourse> selectVipFreeVideo(@Param("vipPrice")double vipPrice);
    
    /**
	 *	查询最新视频。
	 * @return
	 */
    Page<VideoCourse> selectNewVideo();
    
    /**
     *	查询最热门的视频
     */
    Page<VideoCourse> selectHottestVideo();
    
    /**
     *	查询所有的视频
     */
    Page<VideoCourse> selectAllVideo();
    
    //查精品推荐课程
    Page<VideoCourse> selectCourseBoutique();
    //模糊查询精品推荐课程
    List<VideoCourse> selectCourseBoutiqueLike(String courseName);
    //查名家讲坛全部
    List<CourseBean> selectFamousSpeaker();
    //按讲师名查名家讲坛
    Page<VideoCourse> selectFSByTeacherName(@Param("teacherName")String teacherName);
    //按视频id查视频
    CourseBean selectFSByVideoCourseId(@Param("videoCourseId")Integer videoCourseId);
}